<?php
/**
 * User: hufeng
 * Date: 2017/12/13
 * Desc：websocket client
 */
namespace App\Common\Util;
use WebSocket\Client;

class WsClient{

    public function send($param,$ct){
        $client = new Client(WEBSOCKT_SERVER.'?ct='.$ct);
        $param['msgtype'] = $ct;
        $client->send(json_encode($param));
        $client->close();
    }
}